package tawai;

/**
 * Class models Human player.<br>
 * Handles operations with player's vehicle
 * Serves as parent for NPC player class
 *
 * @author Alex
 */
public class Player {

    /**
     * Player's tank
     */
    protected Tank tank;

    /**
     * Determines whether player is alive or not
     */
    protected boolean alive = true;

    /**
     * Getter for player's vehicle
     * @return {@link Tank} controlled by player
     */
    public Tank getVehicle() {

        return tank;
    }

    /**
     * Setter for player's vehicle
     * @param newTank New {@link Tank} for player to control
     */
    public void setVehicle(Tank newTank) {

        tank = newTank;
    }

    /**
     * Called when player's vehicle had been blown
     */
    public void vehicleBlown() {

        alive = false;
    }

    /**
     * Getter for player's alive state
     * @return Is player alive? <code>true/false</code>
     */
    public boolean isAlive() {

        return alive;
    }
}
